<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<link href="${ctx}/img/favicon.ico" rel="shortcut icon" />
<link href="${ctx}/img/favicon.ico" rel="icon" />
<link href="${ctx}/img/favicon.ico" rel="bookmark" />
<!-- ====================CSS=====================  -->
<!-- BootStrap的样式 -->
<link rel="stylesheet" type="text/css" href="${ctx}/css/bootstrap.min.css" />
<!-- EasyUI样式 -->
<link rel="stylesheet" type="text/css" href="${ctx}/js/jquery/easyui/themes/bootstrap/easyui.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/js/jquery/easyui/themes/icon.css" />

<!-- 自定义样式(包含 jQuery Valid样式)-->
<link rel="stylesheet" type="text/css" href="${ctx}/css/back.css" />


<!-- ====================JS=====================  -->
<script type="text/javascript" src="${ctx}/js/jquery/jquery-1.7.1.min.js"></script>
<!-- EasyUI的JS -->
<script type="text/javascript" src="${ctx}/js/jquery/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/js/jquery/easyui/locale/easyui-lang-zh_CN.js"></script>
<!-- jQuery Valid样式 -->
<script type="text/javascript" src="/jqueryvalid/js/jquery.validate.js"></script>
<script type="text/javascript" src="/jqueryvalid/js/diy.validate.js" charset="gb2312"></script><!-- 引入扩展的自定义规则 -->
<script type="text/javascript" src="/jqueryvalid/js/messages_cn.js" charset="gb2312"></script>
<!-- BootStrap的JS -->
<script type="text/javascript" src="${ctx}/js/bootstrap.min.js"></script>
<!-- 一些自定义的通用js -->
<script type="text/javascript" src="${ctx}/js/common.js"></script>


<script type="text/javascript">
	var ctx = "${ctx}";//上下文
	
	/** Session过期需要调用的方法，返回登录框 */
	function login(){
		var r = $('#loginForm').form('validate');
		if(!r) {
			return false;
		}
		var url="${ctx}/admin/login.adm";
		var param = "adminName="+$('#adminName').val();
		param += "&adminPwd="+$('#adminPwd').val();
		$.post(url,param,function(data){
		$('#loginForm').form('clear');
			if(data.success){//操作成功
				location.reload();	
			}else{
				$.messager.alert('提示',data.msg,'warning');	
			}
		});
	}
	
	/**
	 * 打开文件上传对话框
	 * @param setting 
	 * {target:"",
	 * fieldName:"file",
	 * fileExt:""
	 * }
	 */
	function openUpload(setting){
		 var ps=
		 $.extend({
			 target:'uploadWindow',
			 fieldName:'importFile',
			 fileExt:''
		 },setting);
		$("#"+ps.target).window({
  			title:'导入文件',
  			content:'<iframe id="uploadFrame" scrolling="no" frameborder="0" src="${ctx}/pages/common/upload.jsp?fieldName='+ps.fieldName+'&fileExt='+ps.fileExt+'" ' +
  				'orgSrc="${ctx}/pages/common/upload.jsp?fieldName='+ps.fieldName+'&fileExt='+ps.fileExt+'" style="width:100%;height:100%;"></frame>',
  			width:350,
  			height:200,
  			modal:true,
  			shadow:false,
  			minimizable:false,
  			cache:false,
  			maximizable:true,
  			collapsible:false,
  			resizable:false,
  			onLoad: function(){
  				
  			} 			
  		});
	}
</script>

<script type="text/javascript">
	//设置默认的验证规则 jQuery Valid
	$.validator.setDefaults({
		//submitHandler:function(){
		//	alert("submitted!");
		//},
		debug:true,
		//validClass:'checked',//
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("valid");
		}
	});
</script>
 